var t = getApp(), e = t.requirejs('core');
Page({
    data: {
        list: [],
        page: 1,
        isEnd: false
    },
    onLoad() {
        console.clear();
        this.get_list();
    },
    get_list() {
        e.get("syt.merch.get_tao_list", {page: this.data.page}, res => {
            if(res.list.length) {
                let list = this.data.list;
                res.list.forEach(item => {
                    list.push(item)
                })
                this.setData({list})
                console.log(res.list.length);
                res.list.length < res.pagesize && this.setData({
                    isEnd: true
                }), console.log(this.data.isEnd);
            }
        })
    },
    onReachBottom() {
        if(!this.data.isEnd) {
            this.setData({
                page: this.data.page + 1
            });
            this.get_list();
        }
    }
})